AV.init({
    appId: $.Encryption.Cloud.APP_ID,
    appKey: $.Encryption.Cloud.APP_KEY
});
var mapCatch = new Map();
var eventBus={
    isback:true
}
function loadMd(mDbHelper,callback){
    // mDbHelper = $.MdManager.newPageHelper($.Encryption.CloudTable.MdList);
    mDbHelper.errF=function(err){
        callback(null)
    }
   
    mDbHelper.getData(function (result) {
        callback(result)
    })
}
function loadJs(src){
    $.getScript(src, function() {
       console.log(src+'isload')
     });
   
}
function loadMyGroup(mDbHelper,callback){
    // mDbHelper = $.MdManager.newPageHelper($.Encryption.CloudTable.groupNumber);
    mDbHelper.errF=function(err){
        callback(null)
    }
    mDbHelper.equalTo('numberName', $.Encryption.user.bean.name)
    mDbHelper.getData(function (result) {
      
        callback(result)
    })
}

function login(name, pwd, callback) {
    let DbHelper = $.MdManager.newHelper($.Encryption.CloudTable.UserMaster);
    if (name.contain('@')) {
        DbHelper.equalTo('mail', name)
    } else {
        DbHelper.equalTo('name', name)
    }
    DbHelper.equalTo('pwd', pwd)
    DbHelper.getData(function (arg) {

        callback(arg.length > 0, arg[0])
    })
}

function isChina(s){
    var reg = /[^\x00-\xff]/ig;//判断是否存在中文和全角字符
    if (reg.test(s)) {
        return true;//存在中文
    }
    return false;//不存在中文
}
function err(errString){
    
}
function getNetMd(value,callback) {
    var query = new AV.Query($.Encryption.CloudTable.MdList)
    query.equalTo('objectId', value);
    query.find().then(function (data) {
        var json = JSON.parse(JSON.stringify(data));
        if (json != null && json.length > 0) {
            callback(json[0])

        } else {
            err();
        }

    }, function (arg) {
        err();
    });
}

